<?php
!defined('P_W') && exit('Forbidden');

class PW_TypeDataHouseSort {
	function getData($config) {
		$sorttype = $config['sorttype'];
		$num = (int)$config['num'] ? (int) $config['num'] : 10;
		$round = $config['round'];
		$hid = $config['hid'] ? (int) $config['hid'] : 0;
		$element = House::loadClass('housesortelement');
		switch ($config['sorttype']) {
			case 'new':
				return $element->newHouse($round,$num);
			case 'groupbuy':
				return $element->groupBuyHouse($round,$num);
			case 'score':
				return $element->scoreHouse($round,$num);
			case 'hot':
				return $element->hotHouse($round,$num);
			case 'recommend':
				return $element->recommendHouse($round,$num);
			case 'price':
				return $element->newHouse($round,$num,'price',$hid);
			default :
				return array();
		}
	}

}
?>